<%@ tag language="java" pageEncoding="UTF-8"%>
<%@ attribute name="pagination" required="true" rtexprvalue="true"
	type="com.whale.kernel.model.pagination.Pagination"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<c:if test="${pagination != null}">
	<div class="pagination">

		<c:if test="${pagination.prevLink != null}">
			<c:url var="prevUrl" value="${pagination.path}">
				<c:param name="max" value="${pagination.prevLink.max}" />
				<c:param name="offset" value="${pagination.prevLink.offset}" />
			</c:url>
			<a class="pagination_prev" href="${prevUrl}"><fmt:message
					key="page.prev" /> </a>
		</c:if>

		<c:forEach var="step" items="${pagination.stepLinks}"
			varStatus="status">
			<c:url var="stepUrl" value="${pagination.path}">
				<c:param name="max" value="${step.max}" />
				<c:param name="offset" value="${step.offset}" />
			</c:url>
			<a class="${pagination.currentLink==step?'pagination_active':''}"
				href="${stepUrl}">${step.index}</a>

		</c:forEach>

		<c:if test="${pagination.nextLink != null}">
			<c:url var="nextUrl" value="${pagination.path}">
				<c:param name="max" value="${pagination.nextLink.max}" />
				<c:param name="offset" value="${pagination.nextLink.offset}" />
			</c:url>
			<a class="pagination_next" href="${nextUrl}"><fmt:message
					key="page.next" /> </a>
		</c:if>

	</div>
</c:if>